from sqlalchemy import Column, Integer, String, DateTime, func
from config.database import Base

class EmployeeSalary(Base):
    """员工薪资实体"""
    __tablename__ = 'employee_salary'

    id = Column(Integer, primary_key=True, autoincrement=True, comment='薪资ID')
    employee_id = Column(Integer, nullable=False, comment='员工ID')
    last_year_daily_wage = Column(Integer, default=0, comment='去年日薪')
    current_year_daily_wage = Column(Integer, default=0, comment='今年日薪')
    create_time = Column(DateTime, server_default=func.now(), comment='创建时间')
    update_time = Column(DateTime, server_default=func.now(), onupdate=func.now(), comment='更新时间')
    update_by = Column(String(64), comment='更新者')
    del_flag = Column(String(1), default='0', comment='删除标志（0代表存在 2代表删除）')
    create_by = Column(String(64), comment='创建者')

    def __repr__(self):
        return f"<EmployeeSalary(id={self.id}, employee_id={self.employee_id})>" 